package com.yanzhenjie.andserver.sample.model;

public class BaseResponse {
    private boolean success;
    private String message;
    private Object data;

    public BaseResponse() {
        this.success = true;
        this.message = "操作成功";
    }

    public BaseResponse(boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public BaseResponse(boolean success, String message, Object data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public static BaseResponse success() {
        return new BaseResponse();
    }

    public static BaseResponse success(Object data) {
        BaseResponse response = new BaseResponse();
        response.setData(data);
        return response;
    }

    public static BaseResponse error(String message) {
        return new BaseResponse(false, message);
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
} 